package cr.co.tse.padronelectoral.win;

import java.awt.event.ActionEvent;

import javax.swing.AbstractAction;

/**
 * Implementa un Abstract action que wrappea la invocacion a un
 * evento. Usado para capturar el evento de tecleado sobre un
 * dialogo para salir con ESC o aceptar con ENTER.
 * COOL ;)
 * @author jsanca
 */
public class MyAbstractAction extends AbstractAction {

	private static final long serialVersionUID = 7429642647607585235L;

	private IKeyBoardAction action = null;

	public MyAbstractAction(IKeyBoardAction action) {

		this.action = action;
	}

	public void actionPerformed(ActionEvent e) { // my method to
		// close the dialog
		action.action (e);
	}
} // MyAbstractAction.